# 主要执行文件
from pages.ChatPage import ChatPage
from TestBase import TestBase
from ddt import ddt, data
from data.Ddt_data import Ddt_data

from appium import webdriver


# @ddt
class Chat(TestBase):
    """消息"""
    # @data(* Ddt_data.my_data('./data/消息.xlsx','消息'))#路径、excel名字、sheet页名称
    # def test_base_tab(self):
    #     '''消息tab'''
    #     ChatPage(self.driver).locatTab()
    #
    # def test_locatUser(self):
    #     '''对应用户'''
    #     ChatPage(self.driver).locatUser()

    def test_new_sendwenben(self):
        """发送八种语言和表情"""
        ChatPage(self.driver).new_sendwenben()

    def test_send_action(self):
        """再次翻译、转发、删除"""
        ChatPage(self.driver).chat_actions()

    def test_send_album(self):
        """发窗口下边"""
        ChatPage(self.driver).send_album()

    def test_send_photo(self):
        """拍照发"""
        ChatPage(self.driver).send_photo()

    def test_send_redpacket(self):
        """发红包"""
        ChatPage(self.driver).send_redpacket()

    def test_send_gift(self):
        """发礼物"""
        ChatPage(self.driver).send_gift()

    def test_send_card(self):
        """发名片"""
        ChatPage(self.driver).send_card()

    def test_send_yuyin(self):
        """发语音"""
        ChatPage(self.driver).send_yuyin()


# if __name__ == "__main__":
#     desired_caps = {
#         "platformName": "Android",
#         "platformVersion": "9",
#         "deviceName": "c93af3c2",
#         "appPackage": "com.zoneyet.lovehottie",
#         "appActivity": "com.zoneyet.gaga.splash.LaunchActivity",
#         "noSign": False,
#         "automationName": "UIAutomator2",
#         "noReset": False
#     }
#
#     driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
#     driver.implicitly_wait('10')
